package com.ruoyi.project.baoxiu.moban.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.baoxiu.moban.mapper.WarrantyCardMapper;
import com.ruoyi.project.baoxiu.moban.domain.WarrantyCard;
import com.ruoyi.project.baoxiu.moban.service.IWarrantyCardService;

/**
 * 保修卡模板Service业务层处理
 * 
 * @author wyh
 * @date 2024-08-17
 */
@Service
public class WarrantyCardServiceImpl implements IWarrantyCardService 
{
    @Autowired
    private WarrantyCardMapper warrantyCardMapper;

    /**
     * 查询保修卡模板
     * 
     * @param id 保修卡模板主键
     * @return 保修卡模板
     */
    @Override
    public WarrantyCard selectWarrantyCardById(Long id)
    {
        return warrantyCardMapper.selectWarrantyCardById(id);
    }

    /**
     * 查询保修卡模板列表
     * 
     * @param warrantyCard 保修卡模板
     * @return 保修卡模板
     */
    @Override
    public List<WarrantyCard> selectWarrantyCardList(WarrantyCard warrantyCard)
    {
        return warrantyCardMapper.selectWarrantyCardList(warrantyCard);
    }

    /**
     * 新增保修卡模板
     * 
     * @param warrantyCard 保修卡模板
     * @return 结果
     */
    @Override
    public int insertWarrantyCard(WarrantyCard warrantyCard)
    {
        warrantyCard.setCreateTime(DateUtils.getNowDate());
        return warrantyCardMapper.insertWarrantyCard(warrantyCard);
    }

    /**
     * 修改保修卡模板
     * 
     * @param warrantyCard 保修卡模板
     * @return 结果
     */
    @Override
    public int updateWarrantyCard(WarrantyCard warrantyCard)
    {
        return warrantyCardMapper.updateWarrantyCard(warrantyCard);
    }

    /**
     * 批量删除保修卡模板
     * 
     * @param ids 需要删除的保修卡模板主键
     * @return 结果
     */
    @Override
    public int deleteWarrantyCardByIds(Long[] ids)
    {
        return warrantyCardMapper.deleteWarrantyCardByIds(ids);
    }

    /**
     * 删除保修卡模板信息
     * 
     * @param id 保修卡模板主键
     * @return 结果
     */
    @Override
    public int deleteWarrantyCardById(Long id)
    {
        return warrantyCardMapper.deleteWarrantyCardById(id);
    }
}
